package model.effects;

import java.io.Serializable;
import model.game.Item;
import model.game.Player;
import model.game.Skill;

public class EffectDecorator implements Item, Serializable, Skill{
    protected final Item decoratedItem;
    protected final Skill decoratedSkill;
    
    public EffectDecorator(Item decoratedItem){
        this.decoratedItem = decoratedItem;
        this.decoratedSkill = null;
    }
    public EffectDecorator(Skill decoratedSkill){
        this.decoratedSkill = decoratedSkill;
        this.decoratedItem = null;
    }
    
    @Override
    public void use(){
        if (decoratedItem !=null){
            decoratedItem.use();
        }else if(decoratedSkill != null){
            decoratedSkill.use();
        }
        
    }

    @Override
    public String getName() {
        return null;
    }

    @Override
    public boolean isStackable() {
        return false;
    }

    @Override
    public int getMaximumStack() {
        return 0;
    }

    @Override
    public int getStack() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setStack(int stack) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void setName(String name) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Item changeOwner(Player player) {
        return null;
    }

    @Override
    public int getPrice() {
        return 0;
    }

    
}
